<template>
	<view class="favorites">
		<view class="list">
			<view class="selected-conten" v-for="(item,index) in collection" :key="index">
				<image class="selected-img" :src="item.img" mode=""></image>
				<view class="favorites-bottom">
					<view class="name">
						{{item.name}}
					</view>
					<view class="commodityPrice">
						<text class="displayprice"><text class="logo">￥</text>{{item.displayprice}}</text>
						<text class="hideprice"><text class="hiddenlogo">￥</text>{{item.hideprice}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import json from "@/json/my.js"
	export default {
		data() {
			return {
				collection: []
			}
		},
		onLoad() {
			
			this.collection = json.collection;
		},
		methods:{
			
		}
	}
</script>

<style lang="scss">
	page {
		background: #F7F7F7;
	}

	.favorites {
		padding: 16rpx 20rpx;

		.list {
			width: 100%;
			display: flex;
			flex-wrap: wrap;
			align-items: center;
			justify-content: space-between;

			.selected-conten {
				width: 49.2%;
				background: rgba(255, 255, 255, 1);
				border-radius: 12rpx;
				margin-bottom: 16rpx;
				

				.selected-img {
					width: 100%;
					height: 348rpx;
				}

				.favorites-bottom {
					padding: 23rpx 15rpx;

					.name {
						line-height: 30rpx;
						height: 30rpx;
						display: block;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 1;
						overflow: hidden;
						text-overflow: ellipsis;
						word-break: break-all;
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: rgba(40, 40, 40, 1);
					}

					.commodityPrice {
						margin-top: 42rpx;
						display: flex;
						align-items: center;

						.displayprice {
							font-size: 32rpx;
							font-family: PingFang SC;
							font-weight: bold;
							color: #EF1D31;

							.logo {
								font-size: 24rpx;
							}
						}

						.hideprice {
							margin-left: 10rpx;
							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: bold;
							text-decoration: line-through;
							color: #A3A3A3;

							.hiddenlogo {
								font-size: 20rpx;
							}
						}
					}
				}

			}
		}
	}
</style>
